package com.my.admin.service.impl;

import com.my.admin.entity.UserRole;
import com.my.admin.mapper.UserRoleMapper;
import com.my.admin.service.UserRoleService;
import com.my.admin.util.ServiceImplCache;
import org.springframework.cache.annotation.CachePut;
import org.springframework.stereotype.Service;

/**
 * @author my
 */
@Service
public class UserRoleServiceImpl extends ServiceImplCache<UserRoleMapper, UserRole> implements UserRoleService {

    @Override
    @CachePut(cacheNames = "userRole")
    public boolean batchInsert(long userId, Long[] roles) {
        return baseMapper.batchInsert(userId, roles) > 0;
    }

}
